package com.diudiutechnology.www.yadiudiu.util.utils;


import android.content.Context;
import android.view.Gravity;

import com.diudiutechnology.www.yadiudiu.R;


public class MyProgressDialog extends android.app.Dialog {
    public MyProgressDialog(Context context, String strMessage) {
        this(context, R.style.dialog, strMessage);
    }
    public MyProgressDialog(Context context) {
        this(context, R.style.dialog, "");
    }
    public MyProgressDialog(Context context, int theme, String strMessage) {
        super(context, theme);
        this.setContentView(R.layout.myprogressdialog);
        this.getWindow().getAttributes().gravity = Gravity.CENTER;
        this.setCancelable(false);
        this.show();
    }

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {

        if (!hasFocus) {
            dismiss();
        }
    }
}
